<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>购买价格</title>
    <script>
        var jsbook=prompt('请输入购买的《JavaScript》书的数量');
        switch(parseInt(jsbook)){
            case 1:
              jsbook=jsbook*0.9*59.00;
              break;
           case 2:
              jsbook=jsbook*0.8*59.00;
              break;
           case 3:
              jsbook=jsbook*0.7*59.00;
              break;
           default:
              jsbook=jsbook*0.65*59.00;
              break;
        }
        var pen=prompt('请输入购买的钢笔的数量');
        switch(parseInt(pen)){
           case 1:
              pen=pen*0.9*30.00;
              break;
           case 2:
              pen=pen*0.8*30.00;
              break;
           case 3:
              pen=pen*0.7*30.00;
              break;
           default:
              pen=pen*0.65*30.00;
              break;
        }
        var glass=prompt('请输入购买的眼睛的数量');
        switch(parseInt(glass)){
           case 1:
           glass=glass*0.9*199.00;
              break;
           case 2:
           glass=glass*0.8*199.00;
              break;
           case 3:
           glass=glass*0.7*199.00;
              break;
           default:
           glass=glass*0.65*199.00;
              break;
        }
        var milk=prompt('请输入购买的牛奶的数量');
        switch(parseInt(milk)){
           case 1:
              milk=milk*0.9*68.00;
              break;
           case 2:
              milk=milk*0.8*68.00;
              break;
           case 3:
              milk=milk*0.7*68.00;
              break;
           default:
              milk=milk*0.65*68.00;
              break;
        }
        num=jsbook+pen+glass+milk;
        document.write('总价为：'+num+'元')
   
       </script>
   
</head>
<body>
    
</body>
</html>